package com.itheima.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;

@Mapper
public interface MemberMapper {

    /**
     * 根据截至日期查询会员总数量
     * @param localDate
     * @return
     */
    @Select("select count(*) from t_member where t_member.regTime < #{localDate}")
    Integer selectMemberCountByMonth(LocalDate localDate);

    /**
     * 根据日期范围查询新增会员数量
     * @param begin
     * @param end
     * @return
     */
    @Select("select count(*) from t_member where regTime >= #{begin} and regTime < #{end}")
    Integer countMemberByDate(LocalDate begin, LocalDate end);
}
